<h1>Requests</h1>
<?php $model = new Model_Admin_Requests(); ?>

<? if(count($requests)) : ?>
    <table class="w100 ajax_id">
        <tr>
            <th class="border padding10" style="width: 70px;">Order id</th>
            <th class="border padding10" style="width: 70px;">Name</th>
            <th class="border padding10" style="width: 70px;">Last name</th>
            <th class="border padding10" style="width: 70px;">Residence type</th>
            <th class="border padding10" style="width: 70px;">E-mail</th>
            <th class="border padding10" style="width: 70px;">Phone</th>
            <th class="border padding10" style="width: 70px;">Address</th>
            <th class="border padding10" style="width: 70px;">Zip code</th>
            <th class="border padding10" style="width: 70px;">Details</th>
            <th class="border padding10" style="width: 70px;">Delete</th>
        </tr>
        <? foreach ($requests as $request) : ?>
            <tr>
                <td class="border padding10" style="width: 70px;">
                    <?=$request['id']?>
                </td>
                
                <td class="border padding10" style="width: 70px;">
                    <?=$request['name']?>
                </td>
                
                <td class="border padding10" style="width: 70px;">
                    <?=$request['last_name']?>
                </td>

                <td class="border padding10" style="width: 70px;">
                    <?=(isset($request['residence_type'])?$request['residence_type']:'')?>
                </td>
                
                <td class="border padding10" style="width: 70px;">
                    <?=$request['email']?>
                </td>
                
                <td class="border padding10" style="width: 70px;">
                    <?=$request['phone']?>
                </td>

                <td class="border padding10" style="width: 70px;">
                    <?=$request['address']?>
                </td>
                
                <td class="border padding10" style="width: 70px;">
                    <?=$request['zip_code']?>
                </td>

                <td class="border padding10" style="width: 70px;">
                    <?=Html::anchor(Request::$controller.'requests/'.$request['id'] .'/','View Details')?>
                </td>

                <td class="border padding10" style="width: 70px;">
                    <?=Html::anchor(Request::$controller . 'remove/' . $request['id'] . '/', 'Delete', array('onclick' => 'javascript:return confirm(CONFIRMATION_REMOVE)'));?>
                </td>

                
            </tr>
        <? endforeach;?>
    </table>
    <div style="text-align: center;display: none;" id="upBlock"><img src="/images/loader.gif" alt=""/></div>

<script type="text/javascript">

    autoScroll("noid/",$('.ajax_id'),$('#upBlock'));

</script>

<? endif; ?>


